import request from "@/Http/request"

//获取部门
export const GetDept=async(data:any)=>{
    return request({
        url:"/api/Department/ShowDepartment",
        method:"get",
        params:data
    });
};


//级联获取部门
export const GetDeptByParentId=async()=>{
    return request({
        url:"/api/Department/GetDeptByParentId",
        method:"get",
    });
};


//删除部门
export const DeleteDept=async(data:any)=>{
    return request({
        url:"/api/Department/DeleteDept?DepartmentId="+data,
        method:"delete",
    });
};

//新增部门
export const AddDept=async(data:any)=>{
    return request({
        url:"/api/Department/AddDept",
        method:"post",
        data
    });
};


//编辑部门
export const UpdateDept=async(data:any)=>{
    return request({
        url:"/api/Department/UpdateDept",
        method:"put",
        data
    });
};

//修改状态
export const UpdateDeptStatus=async(data:any)=>{
    return request({
        url:"/api/Department/UpdateDeptStatus",
        method:"put",
        params:data
    });
};